/**
 * Created by Administrator on 2017/8/2.
 */
(function(doc, win){
    var docEl = doc.documentElement;
    resizeEvt = 'orientationchange' in window ? 'orientationchange': 'resize',
        recalc = function(){
            var clientWidth = docEl.clientWidth;
            // if (!clientWidth) return;
            var fsize=100 * (clientWidth / 640);
            docEl.style.fontSize = (fsize>100?100:fsize) + 'px';
        };
    recalc();
    if (doc.addEventListener){
        win.addEventListener(resizeEvt, recalc, false);
        doc.addEventListener('DOMContentLoaded', recalc, false);
    }

})(document, window);